<template>
  <view class="logistics">
    <view class="orderDetail-type">
      <view class="orderDetail-type_item">
        <view style="color: #666;">订单编号</view>
        <view>{{ express.orderId }}</view>
      </view>
      
      
      <view class="orderDetail-type_item">
        <view style="color: #666;">快递公司</view>
        <view  class="orderDetail-value">{{ express.expressCompany }}</view>
      </view>
      
      <view class="orderDetail-type_item">
        <view style="color: #666;">快递编号</view>
        <view class="orderDetail-value"><view class="expressNo">{{ express.expressNo }}</view> <text @click="copyEvent">复制</text></view>
      </view>
      </view>
    </view>
    
  </view>
</template>

<script>
	export default {
		data(){
		  return{
			  express: {},
			  id: ''
		  }
		},
		methods: {
			requestExpress() {
				this.request.httpTokenRequest(`/mp-api/wx/order/express/${this.id}`,null,'POST',false).then( res=> {
					if (res.code == 0) {
						this.express = res.data
					}
				})
			},
			copyEvent() {
				uni.setClipboardData({
					data:this.express.expressNo,
					success:function(){
						uni.showToast({
							icon:"none",
							title:'复制成功'
						})
					}
				})
			}
		},
		onLoad(option) {
			if (option.id) {
				this.id = option.id
				this.requestExpress()
			}
		}
	}
</script>

<style scoped>
		
	.orderDetail-value  {
		flex: 1;
		text-align: right;
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}
	.expressNo {
		flex: 1;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 1;
		overflow: hidden;
	}
</style>
